Stored Procedures [dbo].[BAERosterManagementCompanyContact]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@UserIDvarchar(10)10
SQL Script
CREATE PROCEDURE [dbo].[BAERosterManagementCompanyContact]
    @UserID as varchar(10)
AS
    /* General Notes:
    
        Ideally, you would want this procedure to only return one row in order to maximize efficiency.
        Regardless of how it determines who has access, it absolutely must return the ID field from the
        iMIS Name table in some fashion.

        The member type has to be 'CM' in order for the user to have permission to edit the roster.
        This can be changed however, in order to better suit a specific site.  For example, if you wanted
        to add any user with the member type "HOTEL" to have permission to edit the roster, you would
        have to add after the MEMBER_TYPE check:

            OR MEMBER_TYPE IN('HOTEL')

        Furthermore, suppose you have a user that has a certain membership status, but you do not want
        them to have access to roster management.  You can find their user-id, and put at the end of this statement:
        
            AND ID <> '400'

        You must also pass in the User ID of the logged in user, regardless of whether or not it is
        actually used in the procedure.
    */

    --SELECT ID FROM Name WHERE MEMBER_TYPE IN('CM') AND CO_ID <> '' AND ID = @UserID;
    SELECT ID FROM Name WHERE MEMBER_TYPE IN('ROST') AND CO_ID <> '' AND ID = @UserID;

GO
Uses